from pdf2docx import Converter

def pdf_to_word_with_table_style(pdf_file, word_file):
    # 使用pdf2docx库进行PDF到Word转换
    cv = Converter(pdf_file)
    cv.convert(word_file, start=0, end=None)
    cv.close()

if __name__ == '__main__':
    pdf_file = 'input5.pdf'  # 输入的PDF文件
    word_file = 'output5.docx'  # 输出的Word文件

    pdf_to_word_with_table_style(pdf_file, word_file)
